package com.strange.mdl.module.mdl.dal.mysql.incense;

import java.util.*;

import com.strange.mdl.framework.common.pojo.PageResult;
import com.strange.mdl.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.strange.mdl.framework.mybatis.core.mapper.BaseMapperX;
import com.strange.mdl.module.mdl.controller.app.incense.vo.AppIncensePageReqVO;
import com.strange.mdl.module.mdl.dal.dataobject.incense.IncenseDO;
import org.apache.ibatis.annotations.Mapper;
import com.strange.mdl.module.mdl.controller.admin.incense.vo.*;

/**
 * 供香记录 Mapper
 *
 * @author 密谛灵总控
 */
@Mapper
public interface IncenseMapper extends BaseMapperX<IncenseDO> {

    default PageResult<IncenseDO> selectPage(IncensePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IncenseDO>()
                .eqIfPresent(IncenseDO::getBuddha, reqVO.getBuddha())
                .likeIfPresent(IncenseDO::getName, reqVO.getName())
                .eqIfPresent(IncenseDO::getLamp, reqVO.getLamp()));
    }

    default PageResult<IncenseDO> selectAppPage(AppIncensePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IncenseDO>()
                .eqIfPresent(IncenseDO::getBuddha, reqVO.getBuddha())
                .likeIfPresent(IncenseDO::getName, reqVO.getName())
                .eqIfPresent(IncenseDO::getLamp, reqVO.getLamp()));
    }
}